﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Caliburn.Core.Metadata;
using Luna.WPF.ApplicationFramework;
using XWord.Fundamental.Domain.Model;
using Microsoft.Practices.ServiceLocation;
using XWord.Fundamental.Domain;
using System.Threading;
using XWord.WPF.ApplicationFramework;
using XWord.GUI.Presenters.Interface;
using Caliburn.PresentationFramework.ApplicationModel;

namespace XWord.GUI.Presenters.Fundamental
{
    [Singleton(typeof(ExplorersViewTabPresenter))]
    public class ExplorersViewTabPresenter : MultiPresenterManager, ITabPresenter
    {
        private readonly IDockSitePresenter _dockSitePresenter;

        public ExplorersViewTabPresenter()
        {
            this.Index = 2;
            _dockSitePresenter = ServiceLocator.Current.GetInstance<IDockSitePresenter>();
        }

        protected override void OnInitialize()
        {
            var list = ServiceLocator.Current.GetAllInstances<IExporerPresenter>();
            foreach (var item in list)
            {
                Presenters.Add(item);
            }
            
            base.OnInitialize();
        }

        public virtual void ShowRibbon()
        {
            _dockSitePresenter.ShowRibbon(this);
        }

        public int Index {get;set;}
        
    }
}
